home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / libraries / usergroup.h
C/C++ Source or Header  |  1994-10-05  |  2KB  |  81 lines

  1. #ifndef LIBRARIES_USERGROUP_H
  2. #define LIBRARIES_USERGROUP_H \
  3.        "$Id: usergroup.h,v 4.2 1994/10/05 23:18:49 ppessi Exp $"
  4. /*
  5.  *    Definitions of AmiTCP/IP usergroup.library for 32 bit C compilers
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif
  15.  
  16. #ifndef PWD_H
  17. #include <pwd.h>
  18. #endif 
  19. #ifndef GRP_H
  20. #include <grp.h>
  21. #endif
  22. #ifndef UTMP_H
  23. #include <utmp.h>
  24. #endif
  25.  
  26. #ifndef _PID_T
  27. #define _PID_T struct Task *
  28. typedef    _PID_T pid_t;            /* process id */
  29. #endif
  30. #ifndef _MODE_T
  31. #define _MODE_T unsigned short
  32. typedef _MODE_T mode_t;
  33. #endif
  34.  
  35. #define USERGROUPNAME "AmiTCP:libs/usergroup.library"
  36.  
  37. /* Extended password encryption begins with underscore */
  38. #define _PASSWORD_EFMT1 '_'
  39.  
  40. /* Maximum length for password */
  41. #define _PASSWORD_LEN   128
  42.  
  43. /* A user can belong to NGROUPS different groups */
  44. #define NGROUPS 32
  45.  
  46. /* Max length of a login name */
  47. #define MAXLOGNAME      32
  48.  
  49. /* Credentials of a process */
  50. struct UserGroupCredentials {
  51.   uid_t   cr_ruid;
  52.   gid_t   cr_rgid;
  53.   mode_t  cr_umask;        /* umask */
  54.   uid_t   cr_euid;
  55.   short   cr_ngroups;        /* number of groups */
  56.   gid_t   cr_groups[NGROUPS];
  57.   pid_t   cr_session;
  58.   char    cr_login[MAXLOGNAME]; /* setlogin() name */
  59. };
  60.  
  61. /*
  62.  * ID conversion macros
  63.  */
  64. #define UG2MU(id) ((id) == 0 ? 65535 : (id) == -2 ? 0 : (id))
  65. #define MU2UG(id) ((id) == 65535 ? 0L : (id) == 0L ? -2L : (id))
  66.  
  67. /*
  68.  * Context tags
  69.  */
  70. #define UGT_ERRNOBPTR 0x80000001
  71. #define UGT_ERRNOWPTR 0x80000002
  72. #define UGT_ERRNOLPTR 0x80000004
  73. #define UGT_ERRNOPTR(size)\
  74.   ((size == 4) ? UGT_ERRNOLPTR :\
  75.    (size == 2) ? UGT_ERRNOWPTR :\
  76.    (size == 1) ? UGT_ERRNOBPTR : 1L)
  77. #define UGT_OWNER     0x80000011
  78. #define UGT_INTRMASK  0x80000010
  79.  
  80. #endif /* LIBRARIES_USERGROUP_H */
  81.